from django.contrib.auth.models import Group
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet

from sadmin.serializersss.admins_serializers import AdminSerializer
from sadmin.serializersss.permission_serializers import GroupSerializer
from sadmin.utils import Mypage
from users.models import User


class AdminView(ModelViewSet):
    serializer_class = AdminSerializer
    # 获取管理员用户
    queryset = User.objects.filter(is_staff=True)
    pagination_class = Mypage



    # def simple(self, reqeust):
    #     pers = Group.objects.all()
    #     ser = GroupSerializer(pers, many=True)
    #     return Response(ser.data)